import cv2
import matplotlib.pyplot as plt

if __name__ == '__main__':
    img = cv2.imread('kongfu_panda.jpg')
    img1 = plt.imread('kongfu_panda.jpg')

    if img is not None:
        plt.imshow(img1)
        plt.show()
        ROI1 = img[79:510, 345:670, :]
        ROI2 = img[55:345, 15:257, :]
        ROI3 = img[220:497, 207:363, :]
        ROI4 = img[204:503, 605:751, :]
        ROI5 = img[41:417, 673:972, :]
        cv2.imshow('ROI1', ROI1)
        cv2.imshow('ROI2', ROI2)
        cv2.imshow('ROI3', ROI3)
        cv2.imshow('ROI4', ROI4)
        cv2.imshow('ROI5', ROI5)
        cv2.waitKey()
        cv2.destroyAllWindows()
    else:
        print("failed to load image")

